import datetime
import time

import allure

from src.api.base_api import BaseApi
from src.utils.data_model import data_model_list
from src.utils.get_today_time import get_today_time_start, get_today_time_end


class Order_manager(BaseApi):
    def __init__(self, base_url):
        super().__init__(base_url)

    @allure.step('获取订单管理页面的数据')
    def list(self,platform='dy',**kwargs):
        '''
        url=https://ck-medium-api-test.cds8.cn/v1/order/list
        get
        '''
        params={
            'platform':platform,
        }
        for k, v in kwargs.items():
            params[k] = v

        params_model = data_model_list.model_validate(params)
        # params_model = data_model_list(**params)
        params = params_model.model_dump()

        json_res = self.send(method='get',path='order/list',params=params)

        return json_res
